home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-07-21 | 2.4 KB | 60 lines | [TEXT/EDIT] |
- ( Misc extras ) decimal
-
- : EVEN ( n -- n' ) dup 2 mod + ; ( round n up to an even number )
- : ," ( -- ) ( compile a quoted string from input stream )
- 34 word here c@ 1+ even allot ; IMMEDIATE
-
- : TO ( n -- ) ' 2+ ! ; ( set the value of a constant )
-
- : ?COLOR ( -- f ) ( true if color is available )
- here dup >abs
- ,$ 205E ( movea.l [ps]+,a0 )
- ,$ 7001 ( moveq.l #$01,d0 )
- ,$ A090 ( _SysEnvirons )
- 9 + c@ ; ( color qd available? )
-
- : ?DA ( -- flag ) ( true if the DA type is running )
- 0 +md 2@ ( the window's pointer )
- 108 0 d+ l@ 0< ; ( the windowKind integer<0 if DA kind )
-
- : SHRINK ( -- ) ( shrinks free space to 84 bytes )
- room 84 - ( size in excess of 84 bytes )
- negate grow ; ( shrink it )
-
- : XSIZE ( h v -- ) ( change the window size )
- 2dup 8 +md 2! ( set the scroll rect )
- 0 +md 2@ 2>r 2>r 0 >r ,$ A91D ; ( _SizeWindow )
-
- : SPACES ( n -- ) 0 DO space LOOP ; ( emit n spaces )
- : H.2 ( n -- ) ( print a hex number, at least 2 characters long )
- base @ >r hex dup 16 < IF 0 . 8 emit THEN . r> base ! ;
- : A. ( addr -- ) h.2 8 emit ." :" 2 spaces ; ( print address )
- : DUMP ( addr len -- ) ( do a formatted hex dump of memory )
- swap dup -16 and swap dup a. over - ( calc rounded start addr )
- dup 0 DO 3 spaces LOOP ." |" rot + ( indicate start addr )
- over cr a. 0 DO ( do for each len+[rounded.addr - real.addr])
- dup r + c@ h.2 ( print byte value at addr + index )
- r 1+ 16 mod 0= IF ( break at end of 16 byte line )
- ( 2 spaces dup r + 15 - 16 type ( type the line ) ( long )
- dup r + 1+ cr a. THEN LOOP ( start a new line )
- drop cr ;
-
- : 00>R ( rstack: -- 0 0 ) ,$ 42A7 ; macro ( clr.l -[rs] )
- : 2R ( -- d ) ( rstack: d -- d ) ,$ 2D17 ; macro ( move.l [rs],-[ps] )
-
- hex 5854 5445 2constant "TEXT" decimal
- : >CLIP ( c -- ) ( put a character on the clipboard from the stack )
- 256 * ( move ascii data into byte position )
- 00>r ,$ A9FC 2r> 2drop ( _ZeroScrap )
- 00>r 1 0 2>r "TEXT" 2>r sp@ 2>r ,$ A9FE ( _PutScrap )
- 2r> + IF beep THEN ; ( beep on error )
-
- : SP! ( -- ) s0@ ,$ 2C5E ; ( move.l [ps]+,ps ) ( reset pstack )
- : RP! ( -- ) r0@ ,$ 2E5E ; ( move.l [ps]+,rs ) ( reset rstack )
-
- : NIP ( n1 n2 -- n2 ) ,$ 3C9E ; macro ( move [ps]+,[ps] )
- : TUCK ( n1 n2 -- n2 n1 n2 ) swap over ;
-
- : 2- ( n -- n-2 ) ,$ 5556 ; macro ( subq #2,[ps] )
- : 4+ ( n -- n+4 ) ,$ 5856 ; macro ( addq #4,[ps] )
-